#!/usr/bin/env node

const chalk = require('chalk');
const root = require('./src/index');
var crypto = require('crypto');

let nowTime = new Date();
let hour = nowTime.getHours();
console.log(chalk.red.bold.bgWhite('current hour:' + hour));

// if(hour < 13) {
//   //午餐
// }
// else {
//   //晚餐
// }

// console.log(chalk.red.bold.bgWhite('Hello World'));


// console.log(chalk.rgb(255,0,0).bold.bgRgb(0,0,255)('Hello World'));


function md5(data) {
  return crypto.createHash('md5').update(data, 'utf-8').digest('hex');
}

function matching(text) {
  //过滤掉以前不用的.mp3
  //.mp3最多保存一个
}

function start(text = '吃饭了') {
  let key = md5(text);
  root.read(key + '.mp3', text);
}

start('快点 吃饭了，吃饭了， 你听见了没，吃饭了，你听见了没')